home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1993 September / September 93.iso / Archives / Applications / Calculators / NumberCrunch 1.41 / Number Crunch II Demo / Writing External Codes (xCOD) / Pascal source code / Command Dot unit < prev    next >
Encoding:
Text File  |  1992-08-22  |  783 b   |  28 lines  |  [TEXT/PJMM]

  1. { This function can be included in a Pascal program to test whether or not the}
  2. { use is holding down the command-dot key, which is usually used to cancel}
  3. { the current operation.}
  4. {}
  5. { If you're running a particularly long xCOD, you may want allow use this to test whether or}
  6. { not the user wants to leave the xCOD and return to NCII. }
  7. {}
  8.  
  9. unit CommandDot;
  10. interface
  11.     function CommandDotIsDown: boolean;
  12.  
  13. implementation
  14.  
  15.  
  16.     function CommandDotIsDown: boolean;
  17.         var
  18.             theKeyMap: KeyMap;
  19.         const
  20.             cmdID = 55; { from I-251 inside mac}
  21.             periodID = 47; { this is US ; in International keyboard it's 44 (47 is ,)  Should I have a switch that sets this to 44 if user wnats? }
  22.     begin
  23.         GetKeys(theKeyMap);
  24.         CommandDotIsDown := theKeyMap[cmdID] and theKeyMap[periodID];
  25.     end;
  26.  
  27.  
  28. end.